package com.dfbz.demo01;

import java.util.Date;

/**
 * @author lscl
 * @version 1.0
 * @intro:
 */
public class Demo02_常用方法_获取 {
    public static void main(String[] args) {

        // 创建一个Date,指向当前毫秒值
        Date date = new Date();

        System.out.println(date.getDate());         // 28
        System.out.println(date.getDay());          // 3
        System.out.println(date.getHours());          // 11
        System.out.println(date.getMinutes());          // 2
        System.out.println(date.getSeconds());          // 5
        System.out.println(date.getTime());          //1664334125849
        System.out.println(date.getYear());          // 122
        System.out.println(date.getMonth()+1);          // 9


    }
}
